import request from "../../utils/request.js";
//模型管理
//不查询分组模型列表
export const getModelList_Api = () => {
  return request({
    method: "get", //请求方式
    url: "/configuration/model/only/list", //请求地址
  });
};
//模型列表查询
export const getModelSearch_Api = (query) => {
  return request({
    method: "get", //请求方式
    url: "/configuration/model/list", //请求地址
    params: query, //请求参数 参数是对象
  });
};

//指定模型详情查询
export const getModelDetail_Api = (id, query) => {
  return request({
    method: "get", //请求方式
    url: "/configuration/model/" + id, //请求地址
    params: query,
  });
};

//模型新增
export const getAddModel_Api = (data) => {
  return request({
    method: "post",
    url: "/configuration/model",
    data,
  });
};

//模型编辑
export const getEditModel_Api = (data) => {
  return request({
    method: "put",
    url: "/configuration/model",
    data,
  });
};

//模型删除
export const getDelModel_Api = (id) => {
  return request({
    method: "delete",
    url: "/configuration/model/" + id,
  });
};

//模型分组列表
export const getModelCategoryList_Api = () => {
  return request({
    method: "get", //请求方式
    url: "/configuration/model/category/list", //请求地址
  });
};

//模型分组新增
export const getAddModelCategoryList_Api = (data) => {
  return request({
    method: "post", //请求方式
    url: "/configuration/model/category", //请求地址
    data, //请求参数 参数是对象
  });
};

//编辑模型分组
export const getEditModelCategoryList_Api = (data) => {
  return request({
    method: "put", //请求方式
    url: "/configuration/model/category", //请求地址
    data, //请求参数 参数是对象
  });
};

//删除模型分组
export const getModelrList_Api = (id) => {
  return request({
    method: "delete", //请求方式
    url: "/configuration/model/category/" + id, //请求地址
  });
};

//关联类型
//模型关联关系新增
export const getAddModelAssociation_Api = (data) => {
  return request({
    method: "post",
    url: "/configuration/model/association",
    data,
  });
};

//模型关联关系查询
export const getModelAssociationSearch_Api = (query) => {
  return request({
    method: "get",
    url: "/configuration/model/association/list",
    params: query,
  });
};

//模型关联关系编辑
export const getEditModelAssociation_Api = (data) => {
  return request({
    method: "put",
    url: "/configuration/model/association",
    data,
  });
};

//模型关联关系删除
export const getDelModelAssociation_Api = (id) => {
  return request({
    method: "delete",
    url: "/configuration/model/association/" + id,
  });
};

//根据modelId查询模型关联列表
export const getModelAssociation_Api = (id, query) => {
  return request({
    method: "get",
    url: "/configuration/model/association/" + id,
    params: query,
  });
};

//根据关联关系id查询关联关系详情
export const getModelAssociationDetail_Api = (id) => {
  return request({
    method: "get",
    url: "/configuration/model/association/find/" + id,
  });
};

//新增关联类型
export const getAddAssociationType_Api = (data) => {
  return request({
    method: "post",
    url: "configuration/model/association/type",
    data,
  });
};

//编辑关联类型
export const getEditAssociationType_Api = (data) => {
  return request({
    method: "put",
    url: "configuration/model/association/type",
    data,
  });
};

//删除关联类型
export const getDelAssociationType_Api = (id) => {
  return request({
    method: "delete",
    url: "/configuration/model/association/type/" + id,
  });
};

//获取关联类型详细信息
export const getAssociationTypeDetail_Api = (id) => {
  return request({
    method: "get",
    url: "/configuration/model/association/type/" + id,
  });
};

//关联类型列表
export const getAssociationTypeList_Api = (query) => {
  return request({
    method: "get",
    url: "/configuration/model/association/type/list",
    params: query,
  });
};
